import java.util.Stack;

public class Test1 {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(10);
        stack.push(20);
        stack.push(30);
        System.out.println(stack);
        System.out.println("=======");
        int x = stack.pop();
        System.out.println(x);

        int x2 = stack.peek();
        System.out.println(x2);

        x2 = stack.peek();
        System.out.println(x2);
        System.out.println("=======");

        stack.pop();
        stack.pop();
        //stack.pop();  EmptyStackException
        System.out.println(stack.empty());
    }
}
